<?php
/**
 *	description:ZMAXWECHAT main模型文件
 *  author：min.zhang
 *  Email:zhang19min88@163.com
 *	Url:http://www.zmax99.com
 *  copyright:南宁市程序人软件科技有限责任公司保留所有权利
 *  date:2016-04-28
 * @license GNU General Public License version 3, or later
 *  check date:2016-05-26
 *  chcker:min.zhang
 */
 
defined('_JEXEC') or die('You can not access this file');

jimport('joomla.application.component.modeladmin');

class zmaxwechatModelMain extends JModelAdmin
{
	public function getForm( $data = array() , $loadData = true)
	{
		$form = $this->loadForm('com_zmaxwechat.main' ,'main' ,array('control' =>' jform' ,'load_data' => $loadData ));
		if(!$form)
		{
			return false;
		}
		return $form;
	}
	
	public function loadFormData()
	{
		$data = $this->getItem();
		return $data;
	}
	
	
	function getComponentInfo()
	 {
		$zmaxComponent = JComponentHelper::getComponent('com_zmaxwechat');
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select("manifest_cache");
		$query->from("#__extensions");
		$query->where("extension_id =".$zmaxComponent->id);
		$db->setQuery($query);
		$item = $db->loadObject();
		$item = json_decode($item->manifest_cache);
		return $item;
	 }
	 
	function getSystemInfo()
	{		
		jimport( 'joomla.plugin.helper' );
		$zmaxwechatPlg = JPluginHelper::isEnabled("content","zmaxwechat");
		
		
		$system = new stdclass();
		$system->zmaxwechat = $zmaxwechatPlg;
	
		
		return $system;
		
		
	}
}


?>